using System;
using System.Collections.Generic;
using System.Text;
using System.Management.Automation;
using System.Collections;

namespace YaTools.Yaml
{
    [Cmdlet(VerbsData.ConvertFrom, "YAML", SupportsShouldProcess = true)]
    public class ConvertFromYamlCommand : YamlReaderCommand
    {
        [Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true)]

        [AllowEmptyString]
        public string String { get; set; }

        protected override void ProcessRecord()
        {
            try
            {
                WriteObject(YamlLanguage.StringTo<object>(this.String));
            }
            catch (Exception)
            {
            }
        }
    }
}
